while true
do
read -p "请输入用户名：" USERNAME
if [ ! -z $USERNAME ];then
			cat /etc/passwd|awk -F":" '{print $1}'|grep ^$USERNAME$ >/dev/null 2>&1
			if [  $? -eq 0 ];then
			echo "$USERNAME 用户已存在"
			break
			else
				useradd -M -n -s /sbin/nologin $USERNAME
				if [  $? -eq 0 ];then
				echo "$USERNAME 用户创建完成"
				break
				fi
			fi
fi
done
